package com.itheima.mapdemo3;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Teacher implements Comparable<Teacher>{
    private String name;
    private int age;

    @Override
    public int compareTo(Teacher o) {
        return this.age - o.age;        //按年龄升序排列
    }
}
